import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooElementComponentsController } from '../../../controllers';
const uctooelementComponentsRouter = new Router();
const elementComponentsController = new uctooElementComponentsController();

uctooelementComponentsRouter.post('/add', requireUser, elementComponentsController.add);
uctooelementComponentsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/element_components'), elementComponentsController.edit);
uctooelementComponentsRouter.post('/del', requireUser, rowLevelPermission('uctoo/element_components'), elementComponentsController.delete);

//For getting elementComponents with permission control
uctooelementComponentsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/element_components'), elementComponentsController.getSingle);
uctooelementComponentsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/element_components'), elementComponentsController.getMany);
uctooelementComponentsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/element_components'), elementComponentsController.getMany);

//#endregion AutoCreateCode
export default uctooelementComponentsRouter;
